<link rel="stylesheet" type="text/css" href="res/media/css/bbs/topic.css">
<link rel="stylesheet" type="text/css" href="res/plugins/syntaxhighlighter/styles/shCoreDefault.css">
<style>
	hr{
		margin:10px 0px;
	}
	.alert{
		margin-bottom: 10px;
	}
	.module p{
		height:auto;
	}
</style>
<div class="row-fluid ">
	<!-- BEGIN TAB PORTLET-->
	<div class="topic">
		<div class="question module" >
			<div class="title"><h3 style="margin:0px;">{{topic.title}}</h3></div>
			<hr style="">
			<div class="main">
				<div class="detail" ng-model="topic.content" sh-lighter></div>
				<div class="asker ">
					<div class="pull-left">
						<span class="pub_time">发帖于&nbsp;{{topic.create_time | diffDate}}</span>
					</div>
					<div class="info pull-right" title="hewep">
						<span class="ainfo"> 
							<a ui-sref="space({user_id: topic.user_id})"
								target="_blank" title="{{topic.user_name}}">
							<img class="user_pic" ng-src="{{topic.pic_url}}"
								align="absmiddle" alt="{{topic.user_name}}" title="{{topic.user_name}}"></a>
						</span> 
						<span class="pinfo"> 
							<a ui-sref="space({user_id: topic.user_id})"
							target="_blank" title="{{topic.user_name}}">{{topic.user_name}}</a><br> 
							<span><a href="#answers" class="answer_count">{{topic.reply_count}}</a>回/{{topic.view_count}}阅</span>
						</span>
					</div>
					<div class="clear"></div>
				</div>

				<div class="tags_toolbars">
					<div class="Tags" id="tags_nav" style="margin-top: 15px;">
					</div>
				</div>
				<div class="clear"></div>
			</div>

		</div>
		
		<div class="reply module" ng-show="replies.length > 0">
			<ul class="list" >
				<li class="answer alert alert-block alert-info" ng-repeat="reply in replies">
					<div class="row-fluid ">
						<div class="span3 user">
							<span class="user_img">
								<a ui-sref="space({user_id:reply.user_id})" target="_blank">
									<img class="user_pic" ng-src="{{reply.pic_url}}"
									align="absmiddle" alt="{{reply.user_name}}" title="{{reply.user_name}}"></a>
							</span> 
							<span class="user_info"> 
								<a ui-sref="space({user_id:reply.user_id})" title="{{reply.user_name}}"
								target="_blank">{{reply.user_name}}</a> <br>
								<span class="reply-time">{{reply.create_time | diffDate}}</span>
							</span>
							<div class="clear"></div>
						</div>
						<div class="span9 body">
							
							<div class="detail" ng-model="reply.content" sh-lighter></div>
							<div class="replies" >
								<div class="clear"></div>
								<ul >
									<li ng-repeat="comment in reply.comments">
										<span class="comment_item">
											<a href="" class="pull-left">{{comment.sender_name}}</a> 
											<span>&nbsp;&nbsp; {{comment.content}}</span> 
											<span> ({{comment.create_time | diffDate}})&nbsp;&nbsp; 
												<a href="javascript:;" ng-click="showComment(reply, comment);">回复</a>
											</span>
										</span>
										<span class="comment_item" style="margin-left:20px;" ng-repeat="subComment in comment.subComments">
											<a href="">{{subComment.sender_name}}{{subComment.id}}</a> 
											@ <a href="" target="_blank">{{subComment.receiver_name}}</a>
												: {{subComment.content}}
											<span class="t"> ({{subComment.create_time | diffDate}})&nbsp;&nbsp; 
												<span class="opts">
													<a href="javascript:;" ng-click="showComment(reply, comment, subComment.sender_id);">回复</a>
												</span>
											</span>
										</span>	
										<div class="clear"></div>
									</li>
								</ul>
							</div>

							<div class="votes">
								<span class="a_toolbar"> 
									<a href="javascript:;" ng-click="showComment(reply);" >评论({{reply.comments.length}})</a>| <a
									href="/question/answer?question=157976&amp;answer=761708">引用此答案</a>|
									<a href="javascript:;" ng-click="">举报</a>
									
								</span>
							</div>
							
							<div class="clear"></div>
						</div>
						
					</div>
				</li>
			</ul>
		</div>
		<div class="question_answer module">
			<div>
				<ueditor ng-model="reply.content"></ueditor>
				<div class="clear"></div> 
			</div>
			<div class=" bn">
				<span class="error_msg" ng-show="!isLogin">用户尚未登录</span>
				<span class="error_msg" ng-show="answer_content_error">请输入回复内容</span>
				<button class="btn green" ng-click="answer();"><i class="icon-pencil icon-white"></i> 我要回答</button>
			</div>
		</div>
		  
	</div>
	<!-- END TAB PORTLET-->
</div>

<!--评论-->
<div id="comment_modal" class="modal hide fade" tabindex="-1" style="width:400px;margin-left:-200px;">

	<div class="modal-header">
		<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
		<strong>评论{{user_name}}</strong>
	</div>

	<div class="modal-body">

		<div class="row-fluid">
			<div class="alert alert-error" ng-show="comment_content_error" >
				请输入评论内容
			</div>
			<div class="controls">
				<textarea class="m-wrap" rows="4"  style="width:355px!important;" ng-model="comment.content"></textarea>
			</div>
		</div>

	</div>

	<div class="modal-footer" style="padding:10px 15px;">
		<button type="button" data-dismiss="modal" class="btn">关闭</button>
		<button type="button" class="btn green" ng-click="addComment();">提 交</button>
	</div>
</div>
